<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/common/common.jsp" %>
<html>
<head>
    <meta charset="utf-8"/>
    <title>厅干部平时考核管理系统</title>
</head>
<body>
<div class="date_pop" id="date_pop" style="display: block;">
    <div class="khrw_pop">
        <div class="row">
            <div class="row_lf">考核年度</div>
            <div class="row_rt">
                <div class="row_rt_main row_rt_main_border" style="width: 100px;">
                    <input type="text" placeholder="" class="inpt" id="year" value="${task.checkyear}"/>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="row_lf">考核方式</div>
            <div class="row_rt">
                <div class="row_rt_main type_row">
                    <div name="task_type" class="checkbox <c:if test="${task.type=='0'}">checkbox_hov</c:if>" val="0"></div>
                    <div class="checkbox_text">月度考核</div>
                    <div name="task_type" class="checkbox <c:if test="${task.type=='1'}">checkbox_hov</c:if>" val="1"></div>
                    <div class="checkbox_text">季度考核</div>
                    <%--<div name="task_type" class="checkbox <c:if test="${task.type=='2'}">checkbox_hov</c:if>" val="2"></div>
                    <div class="checkbox_text">半年考核</div>
                    <div name="task_type" class="checkbox <c:if test="${task.type=='3'}">checkbox_hov</c:if>" val="3"></div>
                    <div class="checkbox_text">年度考核</div>--%>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="row_lf">考核名称</div>
            <div class="row_rt">
                <div class="row_rt_main row_rt_main_border">
                    <input type="text" placeholder="" class="inpt" id="task_name" value="${task.name}"/>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="row_lf">基准分值</div>
            <div class="row_rt">
                <div class="row_rt_main row_rt_main_border" style="width: 100px;">
                    <input type="text" placeholder="" class="inpt" id="basemark" value="${task.basemark}"/>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="row_lf">考核时间</div>
            <div class="row_rt">
                <div class="row_rt_main row_check_no">
                    <div class="row_rt_main row_rt_main_border" style="width: 100px;">
                        <input type="text" placeholder="" class="inpt" id="check_no" value="${task.checkno}"/>
                    </div>
                    <div class="checkbox_text">
                        <c:if test="${task.type=='0'}">月</c:if>
                        <c:if test="${task.type=='1'}">季度</c:if>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="row_lf">考核开始</div>
            <div class="row_rt">
                <div class="row_rt_main row_rt_main_border" style="width: 100px;">
                    <input type="text" placeholder="" class="inpt" id="startdate" value="${task.startdate}"/>
                </div>
            </div>
            <div class="row_lf">考核截止</div>
            <div class="row_rt">
                <div class="row_rt_main row_rt_main_border" style="width: 100px;">
                    <input type="text" placeholder="" class="inpt" id="enddate" value="${task.enddate}"/>
                </div>
            </div>
        </div>
        <%--<div class="row">
            <div class="row_lf">考核模板</div>
            <div class="row_rt">
                <div class="row_rt_main type_row">
                    <div name="task_model" class="checkbox checkbox_hov" val="0"></div>
                    <div class="checkbox_text">月份考核模板</div>
                    <div name="task_model" class="checkbox" val="1"></div>
                    <div class="checkbox_text">季度考核模板</div>
                    <div name="task_model" class="checkbox" val="2"></div>
                    <div class="checkbox_text">半年考核模板</div>
                    <div name="task_model" class="checkbox" val="3"></div>
                    <div class="checkbox_text">年度考核模板</div>
                </div>
            </div>
        </div>--%>
    </div>
</div>

<script>
    //日期选择器
    jeDate({
        dateCell: "#startdate",
        format: "YYYY-MM-DD"
    });
    jeDate({
        dateCell: "#enddate",
        format: "YYYY-MM-DD"
    });

    function submitForm() {
        var type = $("[name=task_type].checkbox_hov").attr("val");
        $.ajax({
            type: "post",
            dataType: "json",
            url: "<c:url value='/task/saveTask.json'/>",
            data: {
                dbid: ${task.dbid},
                checkyear: $("#year").val(),
                type: type,
                name: $("#task_name").val(),
                basemark: $("#basemark").val(),
                checkno: $("#check_no").val(),
                startdatestr: $("#startdate").val(),
                enddatestr: $("#enddate").val(),
            },
            success: function (data) {
                parent.refresBootTable();
                parent.showMessage("操作成功！");
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            }
        })
    }
</script>
</body>

</html>